<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('username',40)->comment('账号');
            $table->string('password',255)->comment('密码');
            $table->string('truename',20)->default('')
                ->comment('真实名字');
            $table->string('email',50)->default('')
                ->comment('邮箱');
            $table->string('phone',15)->default('')
                ->comment('手机号');
            $table->unsignedInteger('roles_id')->default(0)
            ->comment('角色id');
            $table->char('login_ip',15)->default('')
                ->comment('登录iip');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
